package com.tfswue.group.listener;

import com.tfswue.group.event.UserRegisteredEvent;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

@Component
public class UserEventListener implements ApplicationListener<UserRegisteredEvent> {

    private static final Logger logger =LoggerFactory.getLogger(UserEventListener.class);
    @Override
    public void onApplicationEvent(UserRegisteredEvent event) {
        logger.info("记录用户注册日志: {} | {}",
                event.getUsername(),
                event.getEmail()
        );
    }

}
